// This KEPServerEX example shows how to enumerate all properties of an OPC item. For each property, it displays its Id and description.
//
// Find all latest examples here: https://www.doc-that.com/files/onlinedocs/OPCLabs-ConnectivityStudio/Latest/examples.html .
// OPC client and subscriber examples in C# on GitHub: https://github.com/OPCLabs/Examples-ConnectivityStudio-CSharp .
// Missing some example? Ask us for it on our Online Forums, https://forum.opclabs.com/forum/index ! You do not have to own
// a commercial license in order to use Online Forums, and we reply to every post.
using System;
using OpcLabs.EasyOpc.DataAccess;
using OpcLabs.EasyOpc.DataAccess.AddressSpace;
using OpcLabs.EasyOpc.OperationModel;
namespace DocExamples.Specialized
{
partial class Kepware_KEPServerEX
{
public static void BrowseProperties()
{
// Instantiate the client object.
var client = new EasyDAClient();
DAPropertyElementCollection propertyElements;
try
{
propertyElements = client.BrowseProperties(
"Kepware.KEPServerEX.V6",
"Simulation Examples.Functions.Random1");
}
catch (OpcException opcException)
{
Console.WriteLine("*** Failure: {0}", opcException.GetBaseException().Message);
return;
}
foreach (DAPropertyElement propertyElement in propertyElements)
Console.WriteLine($"PropertyElements(\"{propertyElement.PropertyId.NumericalValue}\").Description: {propertyElement.Description}");
}
}
}